#!/usr/bin/python
# -*- coding: UTF-8 -*-
import numpy as np
import matplotlib.pyplot as plot

x = np.arange(2, 20, 1)
y1 = x ** 2
y2 = np.log(x)

def muit_ax():
    plot.plot(x, y1)
    plot.twinx()
    plot.plot(x, y2)
    plot.show()


def obj():
    fig = plot.figure()
    ax1 = fig.add_subplot(111)
    ax1.plot(x, y1)
    ax1.set_ylabel("y1")
    ax2 = ax1.twinx()
    ax2.plot(x, y2, "r")
    ax2.set_ylabel("y2")
    ax1.set_xlabel("y1 and y2")
    plot.show()


def twiny():
    fig = plot.figure()
    ax1 = fig.add_subplot(111)
    ax1.plot(y1, x)
    ax1.twiny()
    plot.plot(y2, x, color="r")
    plot.show()


muit_ax()

